package com.ninth_group.po;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * 省会天气信息
 */
public class PCWeatherInfo {
    private String cityID;
    private String province;
    private String city;
    private String weather; // 天气, 晴/阴...
    private int temp;
    private int weatherCode;

    // 结果映射
    public static PCWeatherInfo mapRow(ResultSet rs) throws SQLException {
        PCWeatherInfo pcWeatherInfo = new PCWeatherInfo();
        pcWeatherInfo.setCityID(rs.getString("city_id"));
        pcWeatherInfo.setCity(rs.getString("city"));
        pcWeatherInfo.setProvince(rs.getString("province"));
        pcWeatherInfo.setWeather(rs.getString("weather"));
        pcWeatherInfo.setTemp(rs.getInt("temp"));
        return pcWeatherInfo;
    }

    @Override
    public String toString() {
        return "PCWeatherInfo{" +
                "cityID='" + cityID + '\'' +
                ", province='" + province + '\'' +
                ", city='" + city + '\'' +
                ", weather='" + weather + '\'' +
                ", temp=" + temp +
                ", weatherCode=" + weatherCode +
                '}';
    }

    public String getCityID() {
        return cityID;
    }
    public void setCityID(String cityID) {
        this.cityID = cityID;
    }
    public String getProvince() {
        return province;
    }
    public void setProvince(String province) {
        this.province = province;
    }
    public String getCity() {
        return city;
    }
    public void setCity(String city) {
        this.city = city;
    }
    public String getWeather() {
        return weather;
    }
    public void setWeather(String weather) {
        this.weather = weather;
    }
    public int getTemp() {
        return temp;
    }
    public void setTemp(int temp) {
        this.temp = temp;
    }

    public int getWeatherCode() {
        return weatherCode;
    }

    public void setWeatherCode(int weatherCode) {
        this.weatherCode = weatherCode;
    }
}
